-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphql, Web: Add remotes tab, list, add, and delete remotes #313
Conversation
Graphql, Web: Add and delete remote
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. Will pull and run the workbench to check out the UI when it's ready
export type AddRemoteArgs = DBArgs & { remoteName: string; remoteUrl: string }; | ||
export type RemoteArgs = DBArgs & { remoteName: string }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export type AddRemoteArgs = DBArgs & { remoteName: string; remoteUrl: string }; | |
export type RemoteArgs = DBArgs & { remoteName: string }; | |
export type RemoteArgs = DBArgs & { remoteName: string }; | |
export type AddRemoteArgs = RemoteArgs & { remoteUrl: string }; |
} | ||
} | ||
|
||
function getRemoteListRes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably belongs in model
loading, | ||
} = useMutation({ | ||
hook: useAddRemoteMutation, | ||
refetchQueries: refetchBranchQueries(props.params), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be refetchRemoteQueries
?
}; | ||
|
||
const DatabaseRemotesPage: NextPage<Props> = ({ params }) => ( | ||
<Page title={`Add remote for ${params.databaseName}`} noIndex> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Page title={`Add remote for ${params.databaseName}`} noIndex> | |
<Page title={`New remote for ${params.databaseName}`} noIndex> |
params: DatabaseParams; | ||
}; | ||
|
||
const DatabaseRemotesPage: NextPage<Props> = ({ params }) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const DatabaseRemotesPage: NextPage<Props> = ({ params }) => ( | |
const DatabaseNewRemotePage: NextPage<Props> = ({ params }) => ( |
|
||
export default function ForRemotes({ params, newRemote }: Props): JSX.Element { | ||
const feature = newRemote ? "Creating remotes" : "Viewing Remotes"; | ||
console.log("ForRemotes", params, newRemote); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
}; | ||
|
||
export default function ForRemotes({ params, newRemote }: Props): JSX.Element { | ||
const feature = newRemote ? "Creating remotes" : "Viewing Remotes"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const feature = newRemote ? "Creating remotes" : "Viewing Remotes"; | |
const feature = newRemote ? "Creating remotes" : "Viewing remotes"; |
{remote.fetchSpecs?.map((fs, i) => ( | ||
<span key={fs}> | ||
{fs} | ||
{i < (remote.fetchSpecs?.length ?? 0) - 1 ? ", " : ""} | ||
</span> | ||
))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just remote.fetchSpecs?.join(",")
here? Does the span apply any styling?
const [offset, setOffset] = useState(data?.remotes.nextOffset); | ||
const [lastOffset, setLastOffset] = useState<Maybe<number>>(undefined); | ||
|
||
const refetch = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this used anywhere?
let sel = em.createQueryBuilder().select("*").from("dolt_remotes", ""); | ||
sel = sel.offset(args.offset); | ||
|
||
return sel.limit(ROW_LIMIT + 1).getRawMany(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need the let
here? It can all just be chained together?
) | ||
} | ||
`; | ||
|
||
export const DELETE_REMOTE = gql` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should go in RemotesPage
too
No description provided.